<template>
  <div>
    <el-container>
      <el-aside width="200px">
        <el-menu
          router
        >
          <el-submenu
            v-if="item.children"
            v-for="(item,index) in $router.options.routes"
            :index="index+''"
            :key="index">
            <template slot="title"><i class="el-icon-location"></i>{{item.name}}</template>
            <el-menu-item
              v-for="(item2,index2) in item.children"
              :key="item.path"
              :class="$route.path==item2.path?'is-active':''"
              :index="item2.path"
            >{{item2.name}}
            </el-menu-item>
          </el-submenu>
          <el-menu-item v-else :index="item.path">{{item.name}}</el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script>
  export default {
    name: "index",
    data() {
      return {}
    },
    methods: {},
    mounted() {
      console.log(this.$router.options.routes)
    }
  }
</script>

<style scoped>

</style>
